{yun:}include file="$userstyle/header.htm"{/yun}
<div class="yun_w1200">
    {yun:}include file="$userstyle/left.htm"{/yun}
    <div class="yun_m_rightbox fltR mt20 re">
        <div class="member_right_index_h1 fltL"> <span class="member_right_h1_span fltL">收银台</span> <i class="member_right_h1_icon user_bg"></i></div>
        <div class="clear"></div>

        <form name="alipayment" class="layui-form" id="payform" action="{yun:}if $config.alipaytype=='1'&&$config.alipay=='1'{/yun}../api/alipay/alipayto.php{yun:}elseif $config.alipaytype=='2'&&$config.alipay=='1'{/yun}../api/alipaydual/alipayto.php{yun:}elseif $config.alipaytype=='3'&&$config.alipay=='1'{/yun}../api/alipayescow/alipayto.php{yun:}elseif $config.tenpay=='1'&&$config.alipay=='0'{/yun}../api/tenpay/index.php{yun:}/if{/yun}" method="post" {yun:}if $config.tenpay=='1' ||$config.alipay=='1' {/yun}target="_blank" {yun:}/if{/yun} onsubmit="return payforms();" enctype="multipart/form-data">
            <div class="clear"></div>

            <div class="payment_boxtable">

                <table class="" cellpadding="1" cellspacing="1" border="0">
                    <tr>
                        <th width="200">订单编号</th>
                        <th>购买商品</th>
                        <th>备注</th>
                        <th>金额</th>
                    </tr>
                    <tr>
                        <td>{yun:}$order.order_id{/yun}<input type="hidden" name="dingdan" value="{yun:}$order.order_id{/yun}" /></td>
                        
                        <td>
                        	{yun:}if $order.type=='14'{/yun}
								简历置顶
							{yun:}else if $order.type=='15'{/yun}
								委托简历
							{yun:}else{/yun}
								充值{yun:}$config.integral_pricename{/yun}
							{yun:}/if{/yun}

                            
                            <input type="hidden" name="oid" id="oid" value="{yun:}$order.id{/yun}" />
                            <input type="hidden" name="aliorder" id="aliorder" value="{yun:}$order.order_id{/yun}" />
                            <input type="hidden" name="alimoney" value="{yun:}$order.order_price{/yun}" />
                            <input type="hidden" name="pay_type" id="pay_type" value="{yun:}$order.pay_type{/yun}" />

                            <input type="hidden" name="subject" value="{yun:}if $order.type=='14'{/yun}简历置顶{yun:}else if $order.type=='15'{/yun}委托简历{yun:}else{/yun}充值{yun:}$config.integral_pricename{/yun}{yun:}/if{/yun}" /> 
							{yun:}if $order.type==2{/yun}
                            <div class="pay_ment">
                                <em>{yun:}$order.integral{/yun}{yun:}$config.integral_priceunit{/yun}{yun:}$config.integral_pricename{/yun}</em>
                                <input type="hidden" name="integral" value="{yun:}$order.integral{/yun}" />
                            </div>
                            {yun:}/if{/yun}
                        </td>

						<td> 
                        	<em>
								{yun:}if $order.order_remark{/yun}
									{yun:}$order.order_remark{/yun}
								{yun:}else if $order.type=='14'{/yun}
									简历置顶
								{yun:}else if $order.type=='15'{/yun}
									委托简历
								{yun:}else{/yun}
									充值{yun:}$config.integral_pricename{/yun}
								{yun:}/if{/yun}
							</em>
                            <textarea name="alibody" style="display:none;" rows=2 cols=40 wrap="physical">{yun:}$order.remark{/yun}</textarea>
                        </td>
                        <td>￥{yun:}$order.order_price{/yun}</td>
                    </tr>
                </table>

                <div class="payment_boxlist_fk">
                   	 实付款
                    <span class="payment_boxlist_fk_n">￥
          				<span id="order_price">{yun:}$order.order_price{/yun}</span>
                    </span>
                </div>
				
				{yun:}if $config.tenpay=='1'||$config.bank=='1'||$config.alipay=='1' || $config.wxpay=='1'{/yun}
				
                <div class="payment_boxlist_zf" id="pay_style">
					{yun:}if $config.bank=='1'&&is_array($rows)&&$rows{/yun}
						<span class="payment_boxlist_zf_s" id="otherpay">
							<i class="payment_boxlist_zf_icon payment_boxlist_zf_icon_qt"></i>其他支付方式
						</span>
					{yun:}/if{/yun}
					
					{yun:}if $config.tenpay=='1'{/yun}
						<span class="payment_boxlist_zf_s" id="tenpay">
							<i class="payment_boxlist_zf_icon payment_boxlist_zf_icon_cft"></i>财付通支付
						</span>
					{yun:}/if{/yun}
					
					{yun:}if $config.wxpay=='1'{/yun}
						<span class="payment_boxlist_zf_s" id="wxpay">
							<i class="payment_boxlist_zf_icon payment_boxlist_zf_icon_wx"></i>微信支付
						</span>
					{yun:}/if{/yun}
					
					{yun:}if $config.alipay=='1'{/yun}
						<span class="payment_boxlist_zf_s" id="alipay">
							<i class="payment_boxlist_zf_icon payment_boxlist_zf_icon_zfb"></i>支付宝支付
						</span>
					{yun:}/if{/yun}
				</div>


                <div class="bank_box other_pay" style="display: none;">
                    <table width="100%" border="0" cellpadding="1" cellspacing="1" class="my_table_msg" style="background:#ddd">
                        <tr>
                            <th width="8%" height="30" align="center" bgcolor="#F7FAFF">银行名称</th>
                            <th width="5%" height="30" align="center" bgcolor="#F7FAFF">开户人</th>
                            <th width="12%" align="center" bgcolor="#F7FAFF">银行帐户</th>
                            <th width="14%" align="center" bgcolor="#F7FAFF">开户行</th>
                        </tr>
                        {yun:}if is_array($rows){/yun} {yun:}foreach item=blist from=$rows{/yun}
                        <tr>
                            <td height="30" align="center" bgcolor="#FFFFFF">{yun:}$blist.bank_name{/yun}</td>
                            <td height="30" align="center" bgcolor="#FFFFFF">{yun:}$blist.name{/yun}</td>
                            <td align="center" bgcolor="#FFFFFF">{yun:}$blist.bank_number{/yun}</td>
                            <td align="center" bgcolor="#FFFFFF">{yun:}$blist.bank_address{/yun}</td>
                        </tr>
                        {yun:}/foreach{/yun} {yun:}else{/yun}
                        <tr>
                            <td colspan="4" height="26" align="center" bgcolor="#FFFFFF">暂未添加银行</td>
                        </tr>
                        {yun:}/if{/yun}
                    </table>

                    <div class="bank_list_p_box">

                        <div class="bank_list_p">
                            <span class="bank_list_p_s">汇款银行：</span>
                            <input type="text" id="bank_name" name="bank_name" class="bank_list_text" value="{yun:}if $order.bank_name{/yun}{yun:}$order.bank_name{/yun}{yun:}/if{/yun}" placeholder="例如：中国银行+沭阳开发区支行" />
                        </div>
                        <div class="bank_list_p">
                            <span class="bank_list_p_s">汇入账号：</span>
                            <input type="text" id="bank_number" name="bank_number" class="bank_list_text" onkeyup="this.value=this.value.replace(/[^0-9.]/g,'')" value="{yun:}$order.bank_number{/yun}" />
                        </div>
                        <div class="bank_list_p">
                            <span class="bank_list_p_s">汇款金额：</span>
                            <input type="text" id="bank_price" name="bank_price" class="bank_list_text" value="{yun:}$order.order_price{/yun}" />
                        </div>
                        <div class="bank_list_p">
                            <span class="bank_list_p_s">汇款时间：</span>
                            <input type="text" id="bank_time" name="bank_time" class="bank_list_text" />
                        </div>
                        <div class="bank_list_p">
                            <span class="bank_list_p_s">备注</span>
                            <textarea name='order_remark' class="bank_textarea"></textarea>
                        </div>
                        <div class="bank_list_p">
                            <span class="bank_list_p_s">上传汇款单：</span>
                            <button type="button" class="layui-btn layui-btn-normal" id="noupload">选择文件</button>
                            <input type="hidden" id="laynoupload" value="1" />
                        </div>
                        <script type="text/javascript">
                            layui.use(['laydate'], function() {
                                var laydate = layui.laydate,
                                    $ = layui.$;
                                laydate.render({
                                    elem: '#bank_time'
                                });
                            });
                        </script>

                    </div>
                </div>

                <div class="payment_boxlist_zf_bth" id="order_pay">
					
                    <input type="submit" value="确认支付" class="payment_boxlist_zf_bth_a">
                </div>
				{yun:}else{/yun}
					<div class="con_banner_no" style="width:300px;"><span></span><em>网站已关闭支付接口，请联系管理员</em></div>
				{yun:}/if{/yun}

            </div>

        </form>
    </div>
    <div class="clear"></div>
</div>

<div id="wxpayTx" style="display:none;">
    <div class="wx_payment">
        <div class="wx_payment_cont">
            <div class="wx_payment_ewm">正在加载微信二维码,请稍候....</div>
        </div>
        <div class="wx_payment_h2">二维码有效时长为2小时，请尽快支付</div>
        <div class="wx_payment_tip">
            <div class="wx_payment_tip_left">
                <i class="wx_payment_tip_line1"></i>
                <i class="wx_payment_tip_line2"></i>
                <i class="wx_payment_tip_line3"></i>
            </div>
            <div class="wx_payment_tip_right">请使用微信扫一扫<br>扫描二维码支付</div>
        </div>
    </div>
</div>


<div id="payshow" style="width:450px; position:absolute;left:0px;top:0px; background:#fff; display:none;">
    <div class="payment_tip">
        请在新打开的支付页面上完成付款，付款完成前请不要关闭此窗口。<br> 如您在支付过程中遇到问题，请联系客服：
        <span class="payment_tip_s">{yun:}$config.sy_freewebtel{/yun}</span>
    </div>
    <div class="payment_bottom">
        <a href="index.php?c=paylog" class="payment_bottombutt">已完成付款</a>
        <a href="index.php?c=payment&id={yun:}$order.id{/yun}" class="payment_bottom_bth2">重新支付</a>
    </div>
</div>
<script src="{yun:}$config.sy_weburl{/yun}/js/layui.upload.js?v={yun:}$config.cachecode{/yun}" type='text/javascript'></script>

<script>
     $(document).ready(function() {

        $("#wxpay").click(function() {
            document.getElementById('payform').action = "";
            $("#payform").attr("target", "supportiframe");
            $("#wxpay").addClass("payment_boxlist_zf_s_cur");
            $("#otherpay").removeClass("payment_boxlist_zf_s_cur");
            $("#tenpay").removeClass("payment_boxlist_zf_s_cur");
            $("#alipay").removeClass("payment_boxlist_zf_s_cur");
            $(".other_pay").hide();
        });

        $("#alipay").click(function() {
            document.getElementById('payform').action = "../api/alipay/alipayto.php";
            $("#payform").attr("target", "_blank");
            $("#alipay").addClass("payment_boxlist_zf_s_cur");
            $("#otherpay").removeClass("payment_boxlist_zf_s_cur");
            $("#tenpay").removeClass("payment_boxlist_zf_s_cur");
            $("#wxpay").removeClass("payment_boxlist_zf_s_cur");
            $(".other_pay").hide();
			 
        });

        $("#tenpay").click(function() {
            document.getElementById('payform').action = "../api/tenpay/index.php";
            $("#payform").attr("target", "_blank");
            $("#tenpay").addClass("payment_boxlist_zf_s_cur");
            $("#otherpay").removeClass("payment_boxlist_zf_s_cur");
            $("#alipay").removeClass("payment_boxlist_zf_s_cur");
            $("#wxpay").removeClass("payment_boxlist_zf_s_cur");
            $(".other_pay").hide();
			 
        });

        $("#otherpay").click(function() {
            document.getElementById('payform').action = "index.php?c=payment&act=paybank";
            $("#payform").attr("target", "supportiframe");
            $("#otherpay").addClass("payment_boxlist_zf_s_cur");
            $("#alipay").removeClass("payment_boxlist_zf_s_cur");
            $("#tenpay").removeClass("payment_boxlist_zf_s_cur");
            $("#wxpay").removeClass("payment_boxlist_zf_s_cur");
            $(".other_pay").show();
        });

    });

    function payforms() {

        var id = '{yun:}$order.id{/yun}';

        if($("#otherpay").hasClass("payment_boxlist_zf_s_cur")) {
            var pay_bank = "bank";
        } else if($("#alipay").hasClass("payment_boxlist_zf_s_cur")) {
            var pay_bank = "directPay";
        } else if($("#tenpay").hasClass("payment_boxlist_zf_s_cur")) {
            var pay_bank = "tenpay";
        } else if($("#wxpay").hasClass("payment_boxlist_zf_s_cur")) {
            var pay_bank = "wxpay";
        }

        if(pay_bank == '') {
            layer.msg('请选择支付方式！', 2, 8);
            return false;
        } else if(pay_bank == 'bank') {
            if($("#bank_name").val() == "") {
                layer.msg('请填写汇款银行！', 2, 8);
                return false;
            }
            if($("#bank_number").val() == "") {
                layer.msg('请填写汇入账号！', 2, 8);
                return false;
            }
            if($("#bank_price").val() == "") {
                layer.msg('请填写汇款金额！', 2, 8);
                return false;
            }
            if($("#bank_time").val() == "") {
                layer.msg('请填写汇款时间！', 2, 8);
                return false;
            }
        }else if(pay_bank == 'wxpay') {
            var orderId = '{yun:}$order.id{/yun}';
            var coupon = $("input[name='coupon']:checked").val();
            layer.load('执行中，请稍候...', 0);

            $.post('index.php?c=payment&act=wxurl', {
                orderId: orderId,
                coupon: coupon
            }, function(data) {
                layer.closeAll('loading');
                $('.wx_payment_ewm').html(data);
                $.layer({
                    type: 1,
                    title: '微信扫码支付',
                    closeBtn: [0, true],
                    border: [10, 0.3, '#000', true],
                    area: ['320px', '400px'],
                    page: {
                        dom: "#wxpayTx"
                    }
                });
                setInterval("wxorderstatus(" + orderId + ")", 3000);
            })
            return false;
        } else {
            $.layer({
                type: 1,
                title: '提示',
                closeBtn: [0, true],
                border: [10, 0.3, '#000', true],
                area: ['450px', '280px'],
                page: {
                    dom: "#payshow"
                }
            });
        }

    }

    function wxorderstatus(orderid) {
        $.post('{yun:}$config.sy_weburl{/yun}/api/wxpay/wxorder.php', {
            orderid: orderid
        }, function(data) {
            if(data == 1) {
                window.location.href = '';
            }
        });
    }

    layui.use(['form'], function() {
        var form = layui.form,
            layer = layui.layer,
            $ = layui.$;

    });
</script>

{yun:}include file="$userstyle/footer.htm"{/yun}